﻿<%@ Page Language="C#" %>

<%@ Import Namespace="wojilu" %>
<%@ Import Namespace="wojilu.View" %>
<%@ Import Namespace="wojilu.Apps.Qycms.Domain" %>
<%@ Import Namespace="wojilu.Apps.Qycms.Service" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>#{softtitle}</title>
<link href="#{path.css}ybb/css/baselist.css?v=#{cssVersion}" rel="stylesheet" type="text/css" />
<link href="#{path.css}ybb/css/all.css?v=#{cssVersion}" rel="stylesheet" type="text/css" />
<link href="#{path.css}ybb/css/formdiv.css?v=#{cssVersion}" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="#{path.js}ybb/js/jquery.js?v=#{jsVersion}"></script>
<script type="text/javascript" src="#{path.js}ybb/js/control.js?v=#{jsVersion}"></script>
<script type="text/javascript" src="#{path.js}ybb/js/form.js?v=#{jsVersion}"></script>
<script type="text/javascript">

	var resizewindow= null;

	window.onresize = function(){
		var h = $(window).height();
		if(resizewindow!=h){
			sizewindow();
			resizewindow=h;
		}
	}

	function sizewindow(){
		var h = $(window).height();
		if(document.getElementById("mainbodybottonauto")){
			$('.managebottonadd').css({height:h-40});
		}
	}
	var createmain_js_mid_empty = "_{createmain_js_mid_empty}";
	var createmain_js_pnumber_empty = "_{createmain_js_pnumber_empty}";
	var createmain_js_tid_empty = "_{createmain_js_tid_empty}";
	var createmain_js_add_ok = "_{createmain_js_add_ok}";
	var createmain_js_add_no = "_{createmain_js_add_no}";
	var iframename = "#{iframename}";
	iframename = iframename=='' ? "jerichotabiframe_0" : iframename;
	$(document).ready(function(){
	    var h = '#{iframeheightwindow}';
		$('.managebottonadd').css({height:h-40});
		var options = {
			beforeSubmit: formverify,
			success:saveResponse
		}
		$("#creatindex").submit(function() {
			$(this).ajaxSubmit(options);
			return false;
		});
	})




	function formverify(formData) {
	    parent.windowsdig('Loading', 'iframe:#{load}', '400px', '180px', 'iframe', false);
	}
	function saveResponse(options){
		parent.closeifram();
		if (options=='true'){
			alert(createmain_js_add_ok);
		}else{
			alert(createmain_js_add_no+options);
		}
		parent.onaletdoc()
	}
	function lngtype(lng){
		$.ajax({
			type:"POST",
			url: '#{getlngdir}',
			data: 'lng='+lng,
			success:function(data){
				if (data!='') {
					$("#htmldir").empty();
					$("#htmldir").append(data);
				}
			}
		});
		
	}
</script>
</head>

<body>
<form method="post" name="creatindex" id="creatindex" action="#{ActionLink}">
<div id="mainbodybottonauto" class="managebottonadd">
	<div class="maindobycontent">
		<div class="suggestion">
			<span class="sugicon"><span class="strong colorgorning2">_{position_title}</span><span class="colorgorningage">_{createmain_home_creat_title}</span></span>
		</div>
		<div class="manageeditdiv">
			<div class="maneditcontent">
				<table class="formtable">
					<tr class="trstyle2">
						<td class="trtitle01">_{createmain_add_lng}</td>
						<td class="trtitle02">
                            <%var is_alonelng = v.data("is_alonelng").ObjectToInt(); %>
                            <%if (is_alonelng == 1) { %>
								#{home_lng}
								<input type="hidden" name="lng" id="lng" value="#{home_lng}">
                            <%}else { %>
								<select size="1" name="lng" id="lng" onchange="javascript:lngtype(this.value);">
                                    <%var lnglist = v.data("lnglist") as List<Lng>; %>
                                    <%foreach (var row in lnglist) { %>
									<option <%if (row.lng == v.data("home_lng").ToString()) { %>selected<%} %> value="<%=row.lng %>"><%=row.lngtitle %></option>
								<%} %>
								</select>
							<%} %>
						</td>
					</tr>
					<tr class="trstyle2">
						<td class="trtitle01">_{createmain_home_add_path}</td>
						<td class="trtitle02">
                             <%if (is_alonelng == 1) { %>
							/#{htmldir}#{entrance}.#{fileex}
						<%}else { %>
							/#{htmldir}<span id="htmldir">#{home_lng}</span>/#{entrance}.#{fileex}
						<%} %>
						<span class="cautiontitle">_{createmain_home_add_path_mess}</span>
						</td>
					</tr>
				</table>
			</div>
		</div>
	</div>
</div>
<div id="downbotton">
	<div id="subbotton">
		<table border="0" width="100%">
			<tr>
				<td><input type="submit" name="Submit" value="_{botton_cerathtml}" class="buttonface" /></td>
			</tr>
		</table>
	</div>
</div>
</form>
</body>

</html>